project(
    'kkgui',
    'cpp',
    default_options: {
        'cpp_std': 'c++17',
        'c_std':'c17',
        'default_library': 'static',
        'backend': 'vs',
        'buildtype': 'debug',  # plain,debug,debugoptimized,release,minsize
        # 'warnlevel':2,
    },
    version: '1.0.0'
)
add_project_arguments('/utf-8', language: ['cpp', 'c'])

inc = include_directories(['./src/core', './src/components'])

# libary source
kkgui_src = [
    './src/core/KKComm.cpp',
    './src/core/KKApplication.cpp',
    './src/core/KKWindow_Win32.cpp',
    './src/core/KKRenderGdiPlus.cpp',
    # components
    './src/components/KKUIBase.cpp'
]

# system library dependencies
cpp = meson.get_compiler('cpp')
gdiplus_dep = cpp.find_library('gdiplus', required: true)
ime_dep = cpp.find_library('imm32', required: true)

# gdiplus = dependency('gdiplus', method : 'system')
# ime_dep = dependency('imm32', method : 'system')

kkgui_lib = library(
    'kkgui',
    kkgui_src,
    include_directories: inc,
    install: true,
    dependencies: [gdiplus_dep, ime_dep],
    version: '0.2.0',
)

# demo application
demo = executable(
    'demo',
    ['./samples/hello/main.cpp'],
    include_directories: inc,
    link_with: [kkgui_lib],
)

test('demo_test', demo)